#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:__init__.py.py
# author:jackiex
# datetime:2022/2/7 12:50
# software: PyCharm

'''
    this is function  description 
'''

from flask_limiter import Limiter, ExemptionScope
from flask_limiter.util import get_remote_address

from ..utils.response_code import RET

limiter = None


def init_limiter(app):
    global limiter
    limiter = Limiter(
        app=app,
        key_func=get_remote_address,
        default_limits=app.config.get('DEFAULT_LIMITS').split(',')
    )


def init_router(app):
    # version test
    from .apiVersion_newResource import apiversion_new_blueprint
    app.register_blueprint(apiversion_new_blueprint, url_prefix="/api_2_0")

